<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>    
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> 
 
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>  
<!--area_lista_sorgenti.jsp-->
<script type="text/javascript">

    $(document).ready(function () {
        $('#listSorgenti').jtable({
        	paging: true,
        	pagesize: 10,
        	pageList: 'minimal',
        	sorting: 'true',
            title: 'Lista Collaboratori',
            toolbar: {
            	 hoverAnimation: true, //Enable/disable small animation on mouse hover to a toolbar item.
            	 hoverAnimationDuration: 60, //Duration of the hover animation.
           	     hoverAnimationEasing: undefined, //Easing of the hover animation. Uses jQuery's default animation ('swing') if set to undefined.
            	    
                items: [{
                    icon: '/images/excel.png',
                    text: 'Export to Excel',
                    click: function () {
                        //perform your custom job...
                    }
                },{
                    icon: '/images/pdf.png',
                    text: 'Export to Pdf',
                    click: function () {
                        //perform your custom job...
                    }
                }]
            },
            actions: {
                listAction: '<%=request.getContextPath()%>/areaPrivata/ajax/loadSorgenti.html',
                createAction: '<%=request.getContextPath()%>/areaPrivata/ajax/newSorgente.html',
                updateAction: '<%=request.getContextPath()%>/areaPrivata/ajax/editSorgente.html',
                deleteAction: '<%=request.getContextPath()%>/areaPrivata/ajax/deleteSorgente.html'
            },
            fields: {
            	idSorgente: {
                    key: true,
                    list: false,
                    create: false,
                    edit: false
                },
                idSorgUser: {
                    title: 'Id',
                    create: false,
                    edit: false,
                    display: function (data) {
                    	if (data.record) {
                    		return data.record.idSorgUser;
                    	}
                    }
                },
                nome: {
                    title: 'Nome',
					inputClass: 'validate[required]',

                },   
                note: {
                    title: 'Note',
                    width: '5%'
                },
//                 idUserInse: {
//                     create: true,
//                     type: 'hidden',
//                     defaultValue: function (data) {return data.record.idUserInse; }
//                 },
                    
            },
            //Initialize validation logic when a form is created
            formCreated: function (event, data) {
                data.form.validationEngine();
            },
            //Validate form when it is being submitted
            formSubmitting: function (event, data) {
                return data.form.validationEngine('validate');
            },
            //Dispose validation logic when form is closed
            formClosed: function (event, data) {
                data.form.validationEngine('hide');
                //data.form.validationEngine('detach');
            }
        });
        
        $('#listSorgenti').jtable('load');

    });
    
    
</script>
			
			
	<!-- INIZIO CONTENUTO -->
				
<div id="listSorgenti" class="listaJtable"></div>
	<!-- FINE CONTENUTO -->








	</div>
</div>			


<!-- 			<div id="aside"> -->
<!-- 				<h3> -->
<!-- 					Suggerimenti -->
<!-- 				</h3> -->

<!-- 				<h3> -->
<!-- 					Sorgente -->
<!-- 				</h3> -->
<!-- 				<p> -->
<!-- 					Un fornitore rappresenta la provenienza di un servizio, Inserendone uno (o piu' di uno) sara' successivamente possibile assegnargli dei servizi  -->
<!-- 				</p> -->

<!-- 			</div> -->
			